<?php
/**
 * XGPHP 轻量级PHP框架
 * @link http://xgphp.xg3.cn
 * @version 2.0.0
 * @license http://www.apache.org/licenses/LICENSE-2.0
 * @author 讯高科技 <xungaokeji@qq.com>
*/
namespace xg;

abstract class Facade {
	/**
	 * 创建Facade实例
	 * @static
	 * @access protected
	 * @param  string $class	类名或标识
	 * @param  array  $args		变量
	 * @return object
	 */
	protected static function createFacade() {
		$facadeClass = static::getFacadeClass();
		return App::getInstance()->get($facadeClass);
	}

	protected static function getFacadeClass(){}

	public static function __callStatic($method, $params) {
		return call_user_func_array([static::createFacade(), $method], $params);
	}
}
